package edu.arizona.arid.akshen;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.midlet.MIDlet;

import edu.arizona.arid.akshen.controller.FileNavigationController;
import edu.arizona.arid.akshen.controller.NavigationController;

public class AkshenMidlet extends MIDlet {
	private Display display;
	
	private NavigationController navigationController;
	


	public AkshenMidlet() {
		
	}

	public void startApp() {
		display = Display.getDisplay(this);
		navigationController = new NavigationController(this);
		navigationController.setDisplay(display);
		
		FileNavigationController fileNavController = new FileNavigationController();
		navigationController.pushViewController(fileNavController);
		fileNavController.showCurrDir();
		
		/*
		boolean isAPIAvailable = false;
		if (System.getProperty("microedition.io.file.FileConnection.version") != null) {
			isAPIAvailable = true;
			try {
				showCurrDir();
			} catch (SecurityException e) {
				e.printStackTrace();
			} catch (Exception e) {
				e.printStackTrace();
			}
		} else {
			StringBuffer splashText = new StringBuffer(
					getAppProperty("MIDlet-Name")).append("\n").append(
					getAppProperty("MIDlet-Vendor")).append(
					isAPIAvailable ? "" : "\nFileConnection API not available");
			Alert splashScreen = new Alert(null, splashText.toString(), null,
					AlertType.INFO);
			splashScreen.setTimeout(3000);
			display.setCurrent(splashScreen);
		}
		*/
	}

	public void pauseApp() {
	}

	public void destroyApp(boolean cond) {
		notifyDestroyed();
	}
}